from daemon.task import ding_alarm
from flask_restful import Resource
from log import logger


class IndexApi(Resource):
    """ci 安全检查"""

    def get(self):
        return {'msg': 'ok'}


class DingAlarmTestApi(Resource):
    """ding talk 报警 例子api"""

    def get(self):
        logger.info('hello world')
        ding_alarm.delay('大家好, 我是李建龙')
        return {'msg': 'ok'}
